Skip to content

cannon: use constant instead of magic value#12386

Merged
Inphi merged 4 commits intoethereum-optimism:developfrom
zhiqiangxu:calling_convention
Oct 16, 2024
Merged

cannon: use constant instead of magic value#12386
Inphi merged 4 commits intoethereum-optimism:developfrom
zhiqiangxu:calling_convention

Conversation

@zhiqiangxu
Copy link
Copy Markdown
Contributor

@zhiqiangxu zhiqiangxu commented Oct 9, 2024

This PR does 2 things:

  1. Define a constant name for each register according to the spec, so that we can reference to them by name instead of magic number.
  2. Encode the calling convention below into alias constant names.

image

Gradually we should shift to these constant names and stop using magic numbers.

@zhiqiangxu zhiqiangxu requested review from a team and ajsutton October 9, 2024 09:35
@zhiqiangxu zhiqiangxu changed the title use constant instead of magic value cannon: use constant instead of magic value Oct 9, 2024
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.14%. Comparing base (fb62380) to head (00bfabf).
Report is 50 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #12386      +/-   ##
===========================================
- Coverage    64.32%   64.14%   -0.19%     
===========================================
  Files           52       52              
  Lines         4348     4348              
===========================================
- Hits          2797     2789       -8     
- Misses        1376     1385       +9     
+ Partials       175      174       -1     
Flag Coverage Δ
cannon-go-tests 64.14% <100.00%> (-0.19%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
cannon/mipsevm/exec/mips_syscalls.go 92.05% <100.00%> (ø)
cannon/mipsevm/multithreaded/mips.go 93.96% <100.00%> (ø)

... and 1 file with indirect coverage changes

@ajsutton ajsutton requested review from mbaxter and removed request for ajsutton October 11, 2024 00:27
Comment thread cannon/mipsevm/exec/calling_convention.go
Comment thread cannon/mipsevm/exec/calling_convention.go
Comment thread cannon/mipsevm/exec/calling_convention.go Outdated
Comment thread cannon/mipsevm/exec/calling_convention.go
Copy link
Copy Markdown
Contributor

@Inphi Inphi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants